package com.api.shopapi.mapper;

import com.api.shopapi.entity.AskAnswerRecordSiteItem;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface AskAnswerRecordSiteItemMapper {


    @Insert("insert into ask_answer_record_site_item " +
            "(" +
            "AskAnswerRecordSiteItemCode," +
            "AskAnswerRecordSiteCode," +
            "AskAnswerNameCode,"+
            "AskAnswerGroupCode,"+
            "AskAnswerItemName,"+
            "AskAnswerItemCode"+
            ") " +
            "values " +
            "(" +
            "#{askAnswerRecordSiteItem.AskAnswerRecordSiteItemCode}," +
            "#{askAnswerRecordSiteItem.AskAnswerRecordSiteCode}," +
            "#{askAnswerRecordSiteItem.AskAnswerNameCode}," +
            "#{askAnswerRecordSiteItem.AskAnswerGroupCode}," +
            "#{askAnswerRecordSiteItem.AskAnswerItemName}," +
            "#{askAnswerRecordSiteItem.AskAnswerItemCode}" +
            ")" )
    int insert(@Param("askAnswerRecordSiteItem") AskAnswerRecordSiteItem askAnswerRecordSiteItem);


    @Delete("delete from ask_answer_record_site_item where askAnswerRecordSiteItemCode=#{askAnswerRecordSiteItemCode}")
    int delete(@Param("askAnswerRecordSiteItemCode") String askAnswerRecordSiteItemCode);


    @Select("select * from ask_answer_record_site_item where askAnswerRecordSiteItemCode=#{askAnswerRecordSiteItemCode} limit 1")
    AskAnswerRecordSiteItem getByAskAnswerRecordSiteItemCode(@Param("askAnswerRecordSiteItemCode") String askAnswerRecordSiteItemCode);


    @Select("select * from ask_answer_record_site_item where askAnswerReocrdSiteCode=#{askAnswerReocrdSiteCode}")
    List<AskAnswerRecordSiteItem> listByAskAnswerRecordSiteCode(@Param("askAnswerRecordSiteCode") String askAnswerReocrdSiteCode);



}
